#include <stdio.h>

#define SIZE 1024
#define FLUSH_NONE 0
#define FLUSH_LINE 1
#define FLUSH_FULL 2

struct IO_FILE
{
    int flag;//打开方式
    int fileno;//文件描述符
    char buffer[SIZE];//用户层语言缓冲区
    int bufferlen;//缓冲区有效字符个数
    int flush_method;
};
typedef struct IO_FILE myfile;

myfile* myfopen(const char* filename,const char* mode);
int myfwrite(const char* ptr,size_t len,myfile* stream);
void myfflush(myfile* stream);
void myclose(myfile* stream);
